package com.lzy.imagepicker.loader;

import android.content.Context;
import android.widget.ImageView;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.lzy.imagepicker.R;


public class GlideImageLoader implements ImageLoader {

    private GlideImageLoader() {
    }

    private static GlideImageLoader instance = new GlideImageLoader();

    public static GlideImageLoader getInstance() {
        return instance;
    }

    @Override
    public void displayImage(Context context, String path, ImageView imageView, int width, int height) {
        Glide.with(context)
                .load(path)
                .error(R.drawable.image_default)
                .placeholder(R.drawable.image_default)
                .diskCacheStrategy(DiskCacheStrategy.ALL)
                .crossFade()
                .into(imageView);
    }


    @Override
    public void clearMemoryCache() {
    }
}
